using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.SupplyChain.Material.Bill;
using HengTong.Model.Db.SupplyChain.Material;
using TiaoTaoHelper.Wtm.Models;


namespace HengTong.ViewModel.SupplyChain.SysMaterialChangeRequestBillVms
{
    public partial class SysMaterialChangeRequestBillTemplateVm : BaseTemplateVM
    {
        [Display(Name = "物料")]
        public ExcelPropety MaterialExcel = ExcelPropety.CreateProperty<SysMaterialChangeRequestBill>(x => x.MaterialId);
        [Display(Name = "变更原因")]
        public ExcelPropety ChangeReasonExcel = ExcelPropety.CreateProperty<SysMaterialChangeRequestBill>(x => x.ChangeReason);
        [Display(Name = "审批人")]
        public ExcelPropety ApproverExcel = ExcelPropety.CreateProperty<SysMaterialChangeRequestBill>(x => x.Approver);
        [Display(Name = "审批时间")]
        public ExcelPropety ApprovalTimeExcel = ExcelPropety.CreateProperty<SysMaterialChangeRequestBill>(x => x.ApprovalTime);
        [Display(Name = "所属部门")]
        public ExcelPropety GroupExcel = ExcelPropety.CreateProperty<SysMaterialChangeRequestBill>(x => x.GroupId);
        [Display(Name = "所属机构")]
        public ExcelPropety OrgExcel = ExcelPropety.CreateProperty<SysMaterialChangeRequestBill>(x => x.OrgId);
        [Display(Name = "单据编号")]
        public ExcelPropety BillCodeExcel = ExcelPropety.CreateProperty<SysMaterialChangeRequestBill>(x => x.BillCode);
        [Display(Name = "单据状态")]
        public ExcelPropety BillStatusExcel = ExcelPropety.CreateProperty<SysMaterialChangeRequestBill>(x => x.BillStatus);
        [Display(Name = "工作流状态")]
        public ExcelPropety WorkflowStatusExcel = ExcelPropety.CreateProperty<SysMaterialChangeRequestBill>(x => x.WorkflowStatus);
        [Display(Name = "备注")]
        public ExcelPropety RemarkExcel = ExcelPropety.CreateProperty<SysMaterialChangeRequestBill>(x => x.Remark);

	    protected override void InitVM()
        {
            MaterialExcel.DataType = ColumnDataType.ComboBox;
            MaterialExcel.ListItems = DC.Set<SysMaterial>().GetSelectListItems(Wtm, y => y.Name);
            GroupExcel.DataType = ColumnDataType.ComboBox;
            GroupExcel.ListItems = DC.Set<SysGroup>().GetSelectListItems(Wtm, y => y.FullName);
            OrgExcel.DataType = ColumnDataType.ComboBox;
            OrgExcel.ListItems = DC.Set<SysOrg>().GetSelectListItems(Wtm, y => y.Name);
        }

    }

    public class SysMaterialChangeRequestBillImportVm : BaseImportVM<SysMaterialChangeRequestBillTemplateVm, SysMaterialChangeRequestBill>
    {

    }

}
